﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Data;
using System.Runtime.Serialization;

namespace Jzy.Model.OnlineUser
{
    [DataContract]
    public partial class OnlineUserInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "s_OnlineUser";
        }
        public override string GetInsertSql()
        {
            return "insert into s_OnlineUser ( [ID], [Name], [DeptName], [IP], [LastVisitTime]) values ( @ID, @Name, @DeptName, @IP, @LastVisitTime)";
        }
        public override string GetUpdateSql()
        {
            return "update s_OnlineUser set  [Name] = @Name, [DeptName] = @DeptName, [IP] = @IP, [LastVisitTime] = @LastVisitTime where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        /// 
        [DataMember]
        public String DeptName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        /// 
        [DataMember]
        public String IP
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        /// 
        [DataMember]
        public DateTime LastVisitTime
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "deptname":
                    this.DeptName = (String)value;
                    break;
                case "ip":
                    this.IP = (String)value;
                    break;
                case "lastvisittime":
                    this.LastVisitTime = (DateTime)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "deptname":
                    return this.DeptName;
                case "ip":
                    return this.IP;
                case "lastvisittime":
                    return this.LastVisitTime;
                default:
                    return null;
            }
        }
    }
}
